<script>
function deletetax(id) {
	if(confirm('Are you sure you want to delete this tax setting?')) {
		window.location = '<?=base_url()?>admin/system/deletetax/' + id;
	}
}
function createtax() {
	window.location = '<?=base_url()?>admin/system/tax/add';
}
</script>
    	<div class="left">
        	<h1>System Settings</h1>
            <div class="bar">

            	<div class="text">Manage Taxes</div>
            	<div class="cr"></div>
            </div>
            <div class="box">
            	<h3>Taxes List</h3>
                <div class="row-title">
                	<div class="cat-name">Tax name</div>                  
                    <div class="cat-func">Delete</div>
                    <div class="cat-func">Active</div>
                    <div class="cat-func">Edit</div>
                    <div class="cat-func2">Cost</div>
                </div>
                <div id="subcat">
				<?php foreach($taxes as $tax) { ?>
                	<div class="row-item">
                    	<div class="cat-name"><?=$tax['name']?></div>
                        <div class="cat-func"><a href="javascript:deletetax(<?=$tax['id']?>)"><img src="<?=base_url()?>img/backend/icon-delete.png" /></a></div>
                        <?php if($tax['actived'] == 1) { ?>
                        <div class="cat-func"><a href="<?=base_url()?>admin/system/activetax/<?=$tax['id']?>" title="De-active this tax"><img src="<?=base_url()?>img/backend/icon-actived.png" /></a></div>
                        <?php } else if($tax['actived'] == 0) { ?>
                        <div class="cat-func"><a href="<?=base_url()?>admin/system/activetax/<?=$tax['id']?>" title="Active this tax"><img src="<?=base_url()?>img/backend/icon-inactived.png" /></a></div>
                        <?php } ?>
                        <div class="cat-func"><a href="<?=base_url()?>admin/system/tax/edit/<?=$tax['id']?>"><img src="<?=base_url()?>img/backend/icon-view.png" /></a></div>
                        <div class="cat-func2"><?php if($tax['type'] == 1) print $tax['value'].'%'; ?></div>
                    </div>
                <?php } ?>                	
                </div>
            </div>
            <div class="box">
            	<input type="button" class="button rounded" value="Create a tax" onclick="createtax()" />
            </div>
        </div>
        
